<form id="fr" action="<?php echo Utility::getSiteUrl(); ?>/advertisement" method="post">
<input type="button" value="Thêm quảng cáo" onclick="window.location='<?php echo Utility::getSiteUrl();?>/advertisement/add'" />
<table border="1">
	<thead>
		<tr>
			<th>STT</th>
			<th>Tên quảng cáo</th>
			<th>Vị trí</th>
            <th>Hành động</th>
		</tr>
	</thead>
	<tbody>
	<?php
    $size = $ad_list->getSize();
    if($size == 0)
    {
        ?>
    <tr>
        <td colspan="4">Chưa có quảng cáo nào</td>
    </tr>
        <?php
    }
    else
    {
        for($i = 0; $i < $size; $i++)
        {
            $row = $ad_list->getRow($i);
            ?>
    <tr>
        <td><?php echo $i+1; ?></td>
        <td><?php echo $row->name; ?></td>
        <td><input type="hidden" name="id[]" value="<?php echo $row->id; ?>" /><input type="text" name="order<?php echo $row->id; ?>" value="<?php echo $row->a_order; ?>" style="width:30px;border:2px;"/></td>
        <td>
            <input type="button" value="Sửa" onclick="window.location='<?php echo Utility::getSiteUrl() . '/advertisement/edit/' . $row->id;?>'"/>
            <input type="button" value="Xóa" onclick="window.location='<?php echo Utility::getSiteUrl() . '/advertisement/remove/' . $row->id;?>'"/>
        </td>
    </tr>
            <?php
        }
    }
	?>
    <tr>
        <td colspan="4" style="text-align:right"><input type="submit" name="btnSubmit" value="Cập nhật thay đổi" /></td>
    </tr>
	</tbody>
</table>
</form>